package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.CoachMapper;
import com.ruoyi.domain.Coach;
import com.ruoyi.service.ICoachService;

/**
 * 教练Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-14
 */
@Service
public class CoachServiceImpl implements ICoachService 
{
    @Autowired
    private CoachMapper coachMapper;

    /**
     * 查询教练
     * 
     * @param coachId 教练主键
     * @return 教练
     */
    @Override
    public Coach selectCoachByCoachId(Long coachId)
    {
        return coachMapper.selectCoachByCoachId(coachId);
    }

    /**
     * 查询教练列表
     * 
     * @param coach 教练
     * @return 教练
     */
    @Override
    public List<Coach> selectCoachList(Coach coach)
    {
        return coachMapper.selectCoachList(coach);
    }

    /**
     * 新增教练
     * 
     * @param coach 教练
     * @return 结果
     */
    @Override
    public int insertCoach(Coach coach)
    {
        return coachMapper.insertCoach(coach);
    }

    /**
     * 修改教练
     * 
     * @param coach 教练
     * @return 结果
     */
    @Override
    public int updateCoach(Coach coach)
    {
        return coachMapper.updateCoach(coach);
    }

    /**
     * 批量删除教练
     * 
     * @param coachIds 需要删除的教练主键
     * @return 结果
     */
    @Override
    public int deleteCoachByCoachIds(Long[] coachIds)
    {
        return coachMapper.deleteCoachByCoachIds(coachIds);
    }

    /**
     * 删除教练信息
     * 
     * @param coachId 教练主键
     * @return 结果
     */
    @Override
    public int deleteCoachByCoachId(Long coachId)
    {
        return coachMapper.deleteCoachByCoachId(coachId);
    }

    @Override
    public Coach selectCoachByUserName(String userName) {
        return coachMapper.selectCoachByUserName(userName);
    }

    @Override
    public List<Coach> findCoachforCid(Long courseId) {
        return coachMapper.findCoachforCid(courseId);
    }
}
